function speech_save(){
    var speechName = $("#speechName").val();
    var speechContent = $("#speechContent").val();

    if (speechName == ""){
        swal({
            title: "填写有误",
            text: "话术名称不能为空"
        });
        return false;
    }

    $.ajax({
        url : "/speech/speech_save",
        type : "POST",
        traditional : true,
        dataType : "JSON",
        data : {
            speechName : speechName,
            speechContent : speechContent
        },
        success : function(data) {
            swal({
                title: "添加话术信息",
                text: "添加成功"
            }, function () {
                parent.layer.close(window.parent.speech.layerIndex);
            });
            window.parent.speech.table.refresh();
        },error : function () {
            swal({
                title: "添加话术信息",
                text: "添加失败"
            });
        }
    });
}

function cancel() {
    parent.layer.close(window.parent.speech.layerIndex);
}